// import {taskLists} from "../../../utils/data/enterPrise.js"
import {publistTask,getmy} from '../../../utils/api/module/task.js';
Page({
    data: {
        taskLists: [],
        imgs:{
            unAppointmnetImg:'/assets/img/unAppointment.png'
        },
        dataType: 0,
    },
    onLoad: function (options) {
        if(options.dataType) this.data.dataType = 1;
    },
    onShow() {
        this.getLists();
        this.getMyInfo();
    },
    getLists (){
        publistTask({
            mid: wx.getStorageSync('userInfo').mid,
        },{
            Cookie: 'SESSION_='+wx.getStorageSync('session_id'),
        }).then(res=>{
            //暂无数据
            if(res.data.code == 1){
                this.setData({ taskLists: res.data.data });
            };
        })
    },
    getMyInfo(){
        getmy({
            mid: wx.getStorageSync('userInfo').mid,
        },{
            Cookie: 'SESSION_='+wx.getStorageSync('session_id'),
        }).then(res => {
            this.setData({
                certstatus: res.data.data ? res.data.data.certstatus : []
            })
        })
    },
    /**
     * 我预发布的服务组件删除回调
     * @param e
     */
    successCallback(e){
        if(e.detail.code!=0){
            this.getLists();
        }
    },
    onUnload:function() {
        // if(this.data.dataType) {
            wx.navigateBack({
                delta: 2,
            })
        // }
    }
});